package java_IO;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * 高效读取大文件
 */
public class demo_101_readBigFile {
    public static void main(String[] arge) throws IOException {

        long start = System.currentTimeMillis();
        BufferedReader br = new BufferedReader(new FileReader("D:\\用户目录\\我的文档\\WeChat Files\\changfanchangle\\FileStorage\\File\\2019-04\\《大漫画》（校对版全本）作者：三月一.txt"));
        char[] buff = new char[1024];
        int len = -1;
        while( (len = br.read(buff)) != -1 ){
            System.out.print(new String(buff, 0, len));
        }
        long end = System.currentTimeMillis();
        System.out.println("读大文件   BufferedReader + char[], 耗时="+(end-start));
    }
}
